import { useSnippetsStore } from '@renderer/stores'

export function useSearchBrowser () {
  const setSnippets = useSnippetsStore(state => state.setSnippets)

  const searchInBrowser = (content: string, url: string, icon: string) => {
    setSnippets([
      {
        id: 0, 
        title: '浏览器搜索',
        content,
        category_id: 0,
        created_at: '',
        url,
        icon,
      },
    ])
  }

  return {
    searchInBrowser,
  }
}
